package com.sun.androidexerciseproject.function.pay;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

/**
 * Created by Administrator on 2017/5/20.
 */

public abstract class PayWeixin {
    public static void toWeChatScan(Activity activity) {
        try {
            //利用Intent打开微信
            Uri uri = Uri.parse("weixin://dl/wechatout");
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            activity.startActivity(intent);
        } catch (Exception e) {
            //若无法正常跳转，在此进行错误处理
            Toast.makeText(activity, "无法跳转到微信，请检查您是否安装了微信！", Toast.LENGTH_SHORT).show();
        }
    }
}
